// 购物车相关的 api 接口
import request  from '@/utils/requiest'

// 1.加入购物车
export const addCartApi = (userid: string,proid: string,num?: string) =>request.post('/cart/add',{
    userid,proid,num: num  || 1
})





// 2. 查看 购物车
export  const cartListApi = (userid :string) =>request.post('/cart/list',{userid })


// 3.更新 购物车 选中状态
export const updataApi = (cartid:string, flag:boolean) =>request.post('/cart/selectone', {cartid, flag})


// 删除 购物车数据
export const delCartApi = (cartid: string) =>request.post('/cart/remove',{cartid})